package Exercise;

public class Exercise1{
    
     public static int max(int min,int...a) //返回最大值
     {
            int max=min;
            for(int i=0;i<a.length;i++)
            {
                if(max<a[i])
                {
                    max=a[i];
                }
            }
            return max;
        }
        public static long factorial(int n)//计算阶乘
        {
            if(n==0)
            {
                return 1;
            }
            else
            {
                return n*factorial(n-1);
            }
        }
        public static int sum(int a,int b)//计算和
        {
            int c=a+b;
            return c;
        }
        static class Point
{
    public int x;
    public int y;
    public double distance()
    {
        return Math.sqrt(x*x+y*y);
        
    }
    static int STATIC_ONE;
        static
        {
            STATIC_ONE=2;
        }    
}
        public static void main(String[] args) 
    {
        
        
        int[]arr={1,2,3,4};
        for(int elemant:arr)
        {
            System.out.println(elemant);
        }
       int ret =max(0,arr);
       System.out.println(ret);
       System.out.println(factorial(10000));
       int d=Exercise1.sum(1,2);
       System.out.println(d);
        Point p=new Point();
        p.x=2;
        p.y=3;       
       
    }
}
